package com.example.demo1.itlianx01;

public class Student {
    String name;
    private int age;

    public Student() {
    }

    public void setAge(int a) {
        if (a >= 0 && a <= 120) {
            this.age = a;
        } else {
            System.out.println("你给的数值有误");
        }

    }

    public int getAge() {
        return this.age;
    }

    public void show() {
        System.out.println(this.name + "," + this.age);
    }
}
